package com.hrhx.springboot.config;
import org.apache.catalina.Context;

/*** @author https://gitee.com/YYDeament/88ybg
 * 
 * @date 2016/10/1 */
//@Configuration
public class HttpsConfig {
	
//	//@Bean
//	public EmbeddedServletContainerFactory servletContainer() {
//		TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
//
//			@Override
//			protected void postProcessContext(Context context) {
//				SecurityConstraint securityConstraint = new SecurityConstraint();
//				securityConstraint.setUserConstraint("CONFIDENTIAL");
//				SecurityCollection collection = new SecurityCollection();
//				collection.addPattern("/*");
//				securityConstraint.addCollection(collection);
//				context.addConstraint(securityConstraint);
//			}
//		};
//		tomcat.addAdditionalTomcatConnectors(httpConnector());
//		return tomcat;
//	}
//
//	//@Bean
//	public Connector httpConnector() {
//		Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
//		connector.setScheme("http");
//		// 表示用8013端口来供http访问
//		connector.setPort(8013);
//		connector.setSecure(false);
//		// 自动重定向到8012端口
//		connector.setRedirectPort(8012);
//		return connector;
//	}
}
